inspector: fix a crash in the CSS editor
authorSébastien Wilmet <swilmet@gnome.org>
Sun, 24 Aug 2014 18:27:13 +0000 (20:27 +0200)
committerSébastien Wilmet <swilmet@gnome.org>
Mon, 25 Aug 2014 12:25:09 +0000 (14:25 +0200)
commit6525a11b8d1fa6385a307f12df2eb321e7046564
treef7677de55cf3d0e466945828e9e6c650273958e0
parentec17a649aed65fb0a27d6cf10ab097a5f310dfc6
inspector: fix a crash in the CSS editor

gtk_css_section_get_end_position() can return a position one byte beyond
the end of the last line.

gtk_text_buffer_get_iter_at_line_index() accepts only valid
line_number/byte_index pairs. Another solution is to make the
GtkTextBuffer function less strict, by returning a boolean if the exact
position was found.

The CSS parser should also be fixed to always return valid positions.
But it's better to have a safety net in the CSS editor, just in case (a
warning could be print).

https://bugzilla.gnome.org/show_bug.cgi?id=735337
gtk/inspector/css-editor.c